//
//  SegmentView.h
//  鼎立华服
//
//  Created by 中企互联 on 2017/12/13.
//  Copyright © 2017年 中企互联. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void(^titleChooseBlock)(NSInteger x);

typedef NS_ENUM(NSInteger, SegmentStyle) {
    /**
     * By default, there is a slider on the bottom.
     */
    SegmentStyleSlider = 0,
    /**
     * This flag will zoom the selected text label.
     */
    SegmentStyleZoom   = 1,
};

@interface SegmentView : UIScrollView

@property(nonatomic,copy)titleChooseBlock titleChooseReturn;
/**
 * Set segment titles and titleColor.
 *
 * @param titleArray The titles segment will show.
 */
- (void)setTitleArray:(NSArray<NSString *> *)titleArray;

/**
 * Set segment titles and titleColor.
 *
 * @param titleArray The titles segment will show.
 * @param style The segment style.
 */
- (void)setTitleArray:(NSArray<NSString *> *)titleArray withStyle:(SegmentStyle)style;

/**
 * Set segment titles and titleColor.
 *
 * @param titleArray The titles segment will show.
 * @param titleColor The normal title color.
 * @param selectedColor The selected title color.
 * @param style The segment style.
 */
- (void)setTitleArray:(NSArray<NSString *> *)titleArray
            titleFont:(CGFloat)font
           titleColor:(UIColor *)titleColor
   titleSelectedColor:(UIColor *)selectedColor
            withStyle:(SegmentStyle)style;

@property(nonatomic,assign)NSInteger SegmentSelected;

@end

@interface UIView (ViewFrame)

@property(nonatomic,assign)CGFloat Width;

@property(nonatomic,assign)CGFloat Height;

@property(nonatomic,assign)CGFloat CenterX;

@property(nonatomic,assign)CGFloat CenterY;

@end
